const {Schema, model} = require('mongoose')

const ConversationSchema = new Schema(
  {
    participants: [{type: String, ref: 'Users'}],
    messages: [
      {
        type: Schema.Types.ObjectId,
        ref: 'Message',
        default: [],
      },
    ],
  },
  {timestamps: true},
)

module.exports = model('Conversation', ConversationSchema)
